<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Post Property </title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" id="theme" />
<link rel="stylesheet" href="fileupload/jquery.fileupload-ui.css" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />
<script language="JavaScript" src="gen_validatorv4.js" type="text/javascript"></script>
</head>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String imagesPath=basePath+"images/";
	
	String userName=(String)session.getAttribute("userName");			
	if(userName == null)
	{
		response.sendRedirect("index.jsp");
		return;
	}
 %>
<body>

<jsp:include page="/header.jsp" />

<div id="wrapper">
	<!-- start page -->
	<div id="page">
		<jsp:include page="/sideMenuLeft.jsp" />
		<!-- start content -->
		<div id="content">			
			<div class="post">
				<h1 class="title"><a href="#">Post Property</a></h1>
				<p class="byline"><br ></p>
				<div class="entry">
				
				<form id="file_upload" action="upload" method="post" enctype="multipart/form-data">
				<table border="0" align="center">
						<tr>
								<td>
									<b>Upload Property Image</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									
    <div id="drop_zone_1">
        <input id="file_1" type="file" name="file_1" multiple />
        <div>Upload files</div>
    </div>
   <!--<div id="drop_zone_2">
        <input id="file_2" type="file" name="file_2" multiple />
        <div>Upload files</div>
    </div>
    <div id="drop_zone_3">
        <input id="file_3" type="file" name="file_3" multiple />
        <div>Upload files</div>
    </div> -->
    <button>Upload</button>
    
    <table id="files_1" style="background:yellow;"></table>
	<!--  <table id="files_2" style="background:gold;"></table>
	<table id="files_3" style="background:orange;"></table> -->
								</td>
							

							</tr>
							</table>
</form>


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
<script src="fileupload/jquery.fileupload.js"></script>
<script src="fileupload/jquery.fileupload-ui.js"></script>
<script>

/*global $ */
$(function () {
    var initFileUpload = function (suffix) {
        $('#file_upload').fileUploadUI({
            namespace: 'file_upload_' + suffix,
            fileInputFilter: '#file_' + suffix,
            dropZone: $('#drop_zone_' + suffix),
            uploadTable: $('#files_' + suffix),
            downloadTable: $('#files_' + suffix),
            buildUploadRow: function (files, index) {
                return $('<tr><td>' + files[index].name + '<\/td>' +
                        '<td class="file_upload_progress"><div><\/div><\/td>' +
                        '<td class="file_upload_cancel">' +
                        '<button class="ui-state-default ui-corner-all" title="Cancel">' +
                        '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
                        '<\/button><\/td><\/tr>');
            },
            buildDownloadRow: function (file) {
            	document.getElementById("fileLocation").value = "images/" + file.name;
                return $('<tr><td> <img src="<%=imagesPath%>' + file.name + '" /> <\/td><\/tr>');
            }
        });
    };
    initFileUpload(1);
    initFileUpload(2);
    initFileUpload(3);
});
</script> 

					<form action="postPropertyServlet" method="post" id="postProperty">
						<table border="0" align="center" >
							<tr>
								<td colspan="3"></td>
							</tr>

							
							<tr>
								<td>
									<b>Transaction Type</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="radio" name="transactionType" id="transactionType"
										checked="checked" value="sell" />
									Sell <br/>
								
									<input type="radio" name="transactionType" id="transactionType"
										value="rent" />
									Rent/Lease <br/>
								
									<input type="radio" name="transactionType" id="transactionType"
										value="pg" />
									PG
								</td>
							</tr>

							<tr>
								<td>
									<b>Property Type</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="propertyType" name="propertyType">
										<option value="" >
											Select PropertyType
										</option>
										<option value="4">
											Apartment
										</option>
										<option value="1">
											Building
										</option>
										<option value="2">
											Land
										</option>
										<option value="5">
											Form House
										</option>
										<option value="3">
											Guest House
										</option>
										

									</select>

								</td>
							</tr>
							
							<tr>
								<td>
								<b>Property Name</b>
								</td>
								<td>:
								</td>
								<td>
									<input type="text" name="propertyName" id="propertyName"/>
								</td>
							</tr>

							<tr>
								<td>
									<b>Location</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="text" name="location" id="location" />
								</td>
							</tr>

							<tr>
								<td>
									<b>District</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="district" name="district">
										<option value="" >
											Select DistrictName
										</option>
										<option value="1">
											Guntur
										</option>
										<option value="3">
											Prakasam
										</option>
										<option value="2">
											Krishna
										</option>
										<option value="4">
											Nellore
										</option>
										<option value="5">
											Kadapa
										</option>
										<option value="6">
											Srikakulam
										</option>
										<option value="7">
											Vijaya Nagaram
										</option>
										<option value="8">
											Visakapatnam
										</option>
										<option value="9">
											East Godavari
										</option>
										<option value="10">
											West Godavaris
										</option>
										<option value="11">
											Nalgonda
										</option>
										<option value="12">
											Kammam
										</option>
										<option value="13">
											Chitture
										</option>
										<option value="14">
											Ananthapuram
										</option>
										<option value="15">
											Karnole
										</option>
										<option value="16">
											MehaboobNagar
										</option>
										<option value="17">
											Karim Nagar
										</option>
										<option value="18">
											Warangal
										</option>
										<option value="19">
											Adhilabad
										</option>
										<option value="20">
											Medak
										</option>
										<option value="21">
											Ranga Reddy
										</option>
										<option value="22">
											Nijamabad
										</option>


									</select>
								</td>
							</tr>

							<tr>
								<td>
									<b>State</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="state" name="state">
										<option value="" >
											Select StateName
										</option>
										<option value="11">
											Andhra Pradesh
										</option>
										<option value="22">
											Karnataka
										</option>
										<option value="33">
											Tamilnadu
										</option>
										<option value="55">
											Kerala
										</option>
										<option value="44">
											Delhi
										</option>
										<option value="6">
											Panjob
										</option>
										<option value="7">
											Bihar
										</option>
										<option value="8">
											Uttar Pradesh
										</option>
										<option value="9">
											Madya Pradesh
										</option>
										<option value="10">
											Gujarath
										</option>
										<option value="11">
											Maharastra
										</option>
										<option value="12">
											Nagaland
										</option>
										<option value="13">
											Mijoraam
										</option>
										<option value="14">
											Megalaya
										</option>
										<option value="15">
											Gova
										</option>
									</select>
								</td>
							</tr>

							<tr>
								<td>
									<b>Country</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="country" name="country">
										<option value="" >
											Select CountryName
										</option>
										<option value="111">
											India
										</option>
										<option value="2">
											England
										</option>
										<option value="3">
											America
										</option>
										<option value="4">
											Australia
										</option>
										<option value="5">
											South Africa
										</option>
									</select>
								</td>
							</tr>

							<tr>
								<td>
									<b>Area in sq.ft</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="text" name="area" id="area" />
								</td>
							</tr>

							<tr>
								<td>
									<b>Price</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="text" name="price" id="price" />
								</td>
							</tr>



							<tr>
								<td>
									<b>Facing</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="radio" name="facing" id="facing" checked="checked" value="east" />
									East <br/>
								
									<input type="radio" name="facing" id="facing" value="west" />
									West <br/>
								
									<input type="radio" name="facing" id="facing" value="north" />
									South <br/>
								
									<input type="radio" name="facing" id="facing" value="south" />
									North
								</td>
							</tr>

							<tr>
								<td>
									<b>Max no.of Bed Rooms</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="noOfBedRooms" name="noOfBedRooms">
										<option value="0" >
											select
										</option>
										<option value="1">
											1
										</option>
										<option value="2">
											2
										</option>
										<option value="3">
											3
										</option>

									</select>
								</td>
							</tr>

							<tr>
								<td>
									<b>Bathrooms</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="bathrooms" name="bathrooms">
										<option value="0" >
											select
										</option>
										<option value="1">
											1
										</option>
										<option value="2">
											2
										</option>
										<option value="3">
											3
										</option>
									</select>
								</td>
							</tr>

							<tr>
								<td>
									<b>Total No Of Floors</b>
								</td>
								<td>:
								</td>
								<td>
									<input type="text" name="totalNoOfFloors" id="totalNoOfFloors" />
								</td>
							</tr>
							
							<tr>
								<td>
									<b>Floor Number 
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="floorNumber" name="floorNumber">
										<option value="0" >
											F No.s
										</option>
										<option value="1">
											1
										</option>
										<option value="2">
											2
										</option>
										<option value="3">
											3
										</option>
										<option value="4">
											4
										</option>
									</select>
								</td>
							</tr>


							<tr>
								<td>
									<b>Furnishing</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="radio" name="furnished" id="furnished" checked="checked" value="ff" />
									Fully Furnished <br/>
								
									<input type="radio" name="furnished" id="furnished" value="sf" />
									Semi Furnished <br/>
								
									<input type="radio" name="furnished" id="furnished" value="uf" />
									Un Furnished
								</td>
							</tr>

							<tr>
								<td>
									<b>Amenties</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="amenties" name="amenties">
										<option value="" >
											select
										</option>
										<option value="1">
											Club
										</option>
										<option value="2">
											Gym
										</option>
										<option value="3">
											Theater
										</option>
										<option value="4">
											Ground
										</option>
									</select>
								</td>
							</tr>

							<tr>
								<td>
									<b>Landmarks</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="checkbox" name="landmarks" id="landmarks" />
									School <br/>
								
									<input type="checkbox" name="landmarks" id="landmarks" checked="checked" />
									Hospital <br/>
								
									<input type="checkbox" name="landmarks" id="landmarks" />
									Railway Station
								</td>
							</tr>

							<tr>
								<td>
									<b>Is Negotiable</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<input type="radio" name="negotiable" id="negotiable" checked="checked" value="1" />
									Yes <br/>
								
									<input type="radio" name="negotiable" id="negotiable" value="2" />
									No
								</td>
							</tr>

							<tr>
								<td>
									<b>Property Description</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<textarea name="Comment" id="propertyDescription"
										name="propertyDescription" rows="5" cols="20"></textarea>
								</td>
							</tr>

							<tr>
								<td>
									<b>Age of Construction</b>
								</td>
								<td>
									<b>:</b>
								</td>
								<td>
									<select id="ageOfConstruction" name="ageOfConstruction">
										<option value="0" >
											Years
										</option>
										<option value="1">
											1
										</option>
										<option value="2">
											2
										</option>
										<option value="3">
											3
										</option>
									</select>
								</td>
							</tr>



					
							<tr></tr>
							<tr></tr>
							<tr></tr>

							<tr>
								<td></td>
								<td></td>
								<td>
									<input type="submit" value="submit" />
								<td>
							</tr>

						</table>
						<%
							String fileLoc=(String)request.getAttribute("fileLoc");
							if(fileLoc==null)
								fileLoc="";
						 %>
					<input type="hidden" id="fileLocation" name="fileLocation" value='<%=fileLoc%>' />
					</form>

					<script language="JavaScript" type="text/javascript">//<![CDATA[
//You should create the validator only after the definition of the HTML form
  var frmvalidator  = new Validator("postProperty");
  frmvalidator.EnableMsgsTogether();
 
  frmvalidator.addValidation("listingType","radio","Please select  the Listing Type");
  
  frmvalidator.addValidation("transactionType","numeric","Please select  the Transaction Type");
  
  frmvalidator.addValidation("propertyType","numeric","Please select the Property Type");
  
  frmvalidator.addValidation("location","req","Please Enter the Location of the Property");
  
  frmvalidator.addValidation("district","numeric","Max Please select the District Name");
  
  frmvalidator.addValidation("state","numeric","Please select the State Name");
  
  frmvalidator.addValidation("country","numeric","Please select the Country Name");
  
  frmvalidator.addValidation("area","req","Please Enter the Area of the Property");
  
  frmvalidator.addValidation("price","numeric","Please Enter the Cost of the Property");
  
  frmvalidator.addValidation("facing","numeric","Please select the facing of the Property");
  
  frmvalidator.addValidation("noOfBedRooms","numeric","Please select the No.Of Bed Rooms");
  
  frmvalidator.addValidation("furnished","numeric","Please select the Furniture Information");
  
  frmvalidator.addValidation("amenties","numeric","Please select the Amenties");
  
  frmvalidator.addValidation("negotiable","numeric","Please select the Negotiable of the Property");
  
  frmvalidator.addValidation("ageOfConstruction","numeric","Please select the Age of construction");
  
  frmvalidator.addValidation("address","req","Please Enter the Address");
  
  frmvalidator.addValidation("contactNumber","req","Please Enter the Contact Number");
  frmvalidator.addValidation("contactNumber","numeric","Please Enter the Contact Number");
  
   //]]></script>
					
				</div>
			</div>
			
		</div>
		<!-- end content -->
		<!-- start sidebars -->
		<jsp:include page="/sideMenuRight.jsp" />
		<!-- end sidebars -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
</div>
<jsp:include page="/footer.jsp" />
</body>
</html>


